package socketmvc.core.processor.bean.optimizer.ret;

import socketmvc.core.context.IContext;
import socketmvc.core.packets.basic.IPacket;
import socketmvc.core.packets.basic.impl.JsonTextBody;
import socketmvc.core.packets.basic.impl.JsonSimplePacket;
import socketmvc.core.processor.bean.ProcessorMethodReturn;

import java.io.File;

public class DefRetSerializableObjectValOptimizer extends DefAbstractRetOptimizer<Object> {
    @Override
    public IPacket doValue(IContext context, IPacket packet, Object returnVal, JsonTextBody responseTextBody) {
        responseTextBody.setBody(returnVal);
        return new JsonSimplePacket(responseTextBody);
    }
}
